/*****************************************************
Copyright (C) 2020. All rights reserved.
File name     ：BTree.h
Version       ：v1.0
Author        ：zhengqijun
Date          ：2020-05-04
Function List ：
Description   ：B-Tree
******************************************************/

#ifndef BTREE_H_
#define BTREE_H_

// Type Definition
struct BNode;
typedef int ElementType;
typedef struct BNode *Position;
typedef struct BNode *BTree;

// Function Lists
BTree MakeEmpty(BTree T);
int IsEmpty(BTree T);
int IsLeaf(BTree T);
Position Find(ElementType Key, BTree T);
int FindIndex(ElementType Key, Position P);
Position FindMin(BTree T);
Position FindMax(BTree T);
ElementType RetrieveMin(Position P);
ElementType RetrieveMax(Position P);
BTree Insert(ElementType Key, BTree T);
BTree Delete(ElementType Key, BTree T);

// PrintBTree for testing
void PrintBTree(BTree T);

#endif  /* BTREE_H_ */

// EOF

